package com.key.modules.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.key.modules.cache.MybatisCache;
import com.key.modules.entity.SysRole;
import org.apache.ibatis.annotations.CacheNamespace;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author：朕
 * @Package：com.key.modules.mapper
 * @Project：logistics_system
 * @name：SysRoleMapper
 * @Date：2023/3/23 20:07
 * @Filename：SysRoleMapper
 */
@Repository
@CacheNamespace(implementation = MybatisCache.class, eviction = MybatisCache.class)
public interface SysRoleMapper extends BaseMapper<SysRole> {

    //根据角色名称查询
    SysRole findRoleByName(String roleName);

    //增加角色权限
    int addMenuIdByRoleId(Map map);

    //删除角色权限
    int deleteMenuIdByRoleId(Integer roleId);

    //根据用户id查询角色信息
    List<SysRole> findSysRoleByUserId(Integer userId);

}
